-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFUNC3.ASM
3841 lines (3400 loc) · 52.3 KB
/
FUNC3.ASM
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;FUNC3.ASM
DATA SEGMENT WORD PUBLIC
public degnowP1
extrn varmark:byte,postmark:byte,plusmark:byte
extrn calcsp:word,calcsp_limit:word,environment:word
extrn defsegdata:word,polymodulus:dword
extrn xpos:byte,ypos:byte,chars1:byte,btmline:byte
if graph
extrn chxpos:word,chypos:word
extrn viewx1:word,viewy1:word,viewy2:word
endif
extrn fnamebuf:byte
extrn pointword:word
; extrn packeddata:word,packedlength:word,packedptr:word
extrn ascend:word
extrn X_adr:word,Z_adr:word,Z_limadr:word,deg_now:word
extrn schoolflg:byte
extrn machinetype:word
degnowP1 dw ?
DATA ENDS
CODE SEGMENT WORD PUBLIC
ASSUME CS:CODE,DS:DATA
public func3in,polyin,returnadr,linkpack
extrn formul:near,farformul:far
extrn kakko:near,kakko_ax:near,farkakko_ax:far
extrn get_ax:near,farget_ax:far
extrn getvadr:near,fargetvadr:far
extrn ahedsp:near
extrn resin:near
extrn idivIIdisi:near,idivin:near,mulin:near
extrn floorin:near,ceilin:near
extrn farKANJI1ST?:far
extrn farKAKKO:far
extrn farBinasc:far
extrn farPrint_calcsp:far,print_calcsp_out:far
extrn farmul_calcsp:far
extrn farRes_calcsp:far
extrn farmulIIdisi:far,fargcdreswork2:far
extrn farsquareIdi:far
extrn faraddAAdisi:far
extrn farchgsigndi:far
extrn synerr:near,ilgerr:near,calcsperr:near
extrn ovrerr:near,systemerr:near
FUNC3IN:
; pop ax ;return address offset
; push cs ;set stack for RETF
; push ax ;
jmp far ptr func3main
;
; * jumped from code to return
; A(in CODE) が B(in CODE) を call し、B が C(in CODE) に jump
; し、C から直接 A に戻っていたが、C が CODE2 に移ったので
; B から C へは far jump に代え、C からこの returnadr に far jump
; することにした。
returnadr:
ret
;
; * link pack
;
linkpack_pack:
mov bx,di
mov ax,[si+2]
add [di+2],ax ;new # of members
mov ax,[di]
and ax,lenmask
mov dx,ax ;memo old len
inc ax
add ax,ax
add di,ax
lodsw
and ax,lenmask
dec ax
mov cx,ax
add ax,dx
cmp ax,limitword
ja linkpackover
add si,2
rep movsw
or ah,packmaskhigh
mov [bx],ax
ret
linkpackover:
jmp ovrerr
linkpackilgerr:
jmp ilgerr
linkpack:
call get2args
backsp_mac
mov ah,[si+1]
mov al,[di+1]
and ax,attribmaskdouble
cmp ax,packmaskdouble
je linkpack_pack
cmp al,packmaskhigh
je linkpack_nonpack
cmp ah,packmaskhigh
je linknonpack_pack
jmp linkpackilgerr ;both nonpack
linknonpack_pack:
mov bx,di ;base adr
mov ax,[di]
mov dx,[si]
and ax,lenmask
and dx,lenmask
inc ax
mov cx,ax
add ax,dx
cmp ax,limitword
ja linkpackover
;slide up 1st data
push si
add di,cx
add di,cx
lea si,[di-2]
add di,2
push di
std
rep movsw
cld
or ah,packmaskhigh
mov [bx],ax ;set new attribute
;append second data
pop di
pop si
add di,2
mov cx,dx
mov dx,[si+2] ;memo old # of members
add si,4
inc dx
dec cx
mov [bx+2],dx ;set new # of members
rep movsw
ret
linkpack_nonpack:
mov bx,di
inc word ptr [di+2] ;inc # of members
mov ax,[di]
and ax,lenmask
mov dx,ax ;memo old len
inc ax
add ax,ax
add di,ax
mov ax,[si]
and ax,lenmask
inc ax
mov cx,ax
add ax,dx
cmp ax,limitword
ja linkpackover
rep movsw
or ah,packmaskhigh
mov [bx],ax
ret
;
; * set polynomial
;
setmodpolyin:
set32
mov [si-2],ax ;store modulus
add si,2
mov [packedptr],si
dwpoly10:
mov ax,[packedlength]
add ax,2
cmp ax,limitword
ja polyovererr
mov [packedlength],ax
call formul
mov si,[calcsp]
mov dh,[si+1]
and dh,attribmaskhigh
jnz polyilgerr ;if not integer
call ahedsp
set32
mov ax,word ptr [polymodulus]
set32
mov [si+2],ax
set32
shr ax,16
mov cx,1
or ax,ax
jz dwpoly15
inc cx
dwpoly15:
mov [si],cx
call resin ;[di] = [di] @ polymodulus
mov ax,[calcsp]
mov si,ax
add ax,unitbyte
mov [calcsp],ax
set32
xor ax,ax
mov cx,[si]
add si,2
or cx,cx
jz dwpoly20
set32
mov ax,[si]
dec cx
jnz dwpoly20
set32 ;cut higher 16 bit
shl ax,16 ;
set32 ;
shr ax,16 ;
dwpoly20:
mov di,[packedptr]
set32
stosw
mov [packedptr],di
mov al,[bp]
inc bp
cmp al,0c2h ;,
je dwpoly10
cmp al,')'
jne polysynerr
mov cx,di ;search nonzero highest
mov si,[calcsp]
sub cx,si
sub cx,6
shr cx,2
set32
xor ax,ax
sub di,4
std
set32
repe scasw
cld
je dwpoly230 ;all zero
add cx,2 ;recover over decrement by scasd + modulus
shl cx,1
or ch,modpolymaskhigh
dwpoly230:
mov di,[calcsp]
mov [di],cx
jmp polyout
polyilgerr:
jmp ilgerr
polyovererr:
jmp ovrerr
polysynerr:
jmp synerr
polyin:
cmp byte ptr [bp],')'
je polyilgerr ;empty poly is ilegal
push [packeddata]
push [packedlength]
push [packedptr]
call ahedsp
add si,4
mov [packedptr],si
mov [packeddata],0
mov [packedlength],1
set32
mov ax,word ptr [polymodulus]
set32
or ax,ax
jnz setmodpolyin
poly10:
call formul
mov si,[calcsp]
mov dh,[si+1]
and dh,attribmaskhigh
jz poly30 ;if integer
cmp dh,pointmaskhigh
je poly30 ;if fraction
cmp dh,ratmaskhigh
je poly30 ;if rational
cmp dh,complexmaskhigh
jne polyilgerr
poly30:
mov ax,[calcsp]
mov si,ax
add ax,unitbyte
mov [calcsp],ax
mov ax,[si]
and ax,lenmask
inc ax
mov cx,ax
add ax,[packedlength]
cmp ax,limitword
ja polyovererr
mov [packedlength],ax
inc [packeddata]
mov di,[packedptr]
rep movsw
mov [packedptr],di
mov al,[bp]
inc bp
cmp al,0c2h ;,
je poly10
cmp al,')'
jne polysynerr
mov di,[calcsp]
add di,2
mov cx,[packeddata] ;search nonzero highest
xor bx,bx
xor dx,dx
lea si,[di+2]
poly120:
inc bx
lodsw
and ax,lenmask
jz poly130
mov dx,bx ;nonzero position
shl ax,1
add si,ax
mov di,si ;
poly130:
myloop poly120
mov ax,di
mov di,[calcsp]
sub ax,di
shr ax,1
dec ax
jz poly140 ;all zero
or ah,polymaskhigh
mov [di+2],dx
poly140:
mov [di],ax
polyout:
pop [packedptr]
pop [packedlength]
pop [packeddata]
ret
;
; * lcm
;
LCMIN:
checkcalcsp 4
call formul
lcmlp:
cmp byte ptr [bp],0c2h ;code of ,
jne lcmsynerr
inc bp
call formul ;get next argument
call lcmsub
cmp byte ptr [bp],')'
jne lcmlp
inc bp
ret
lcmsynerr:
jmp synerr
lcm_etc:
sub [calcsp],2*unitbyte ;+2
cmove -1,-3
cmove 0,-2
call GCD_ENT ;+1
call idivin ;0
jmp mulin ;-1 call & ret
lcmsub:
mov si,[calcsp]
lea di,[si+unitbyte] ;di=old argument
mov al,[di+1]
mov ah,[si+1]
and ax,attribmaskdouble
jnz lcm_etc
mov ax,[si]
mov dx,[di]
cmp word ptr [si],0
je lcmsub0
cmp word ptr [di],0
je lcmsub0
call GETGCD
mov di,[calcsp]
mov si,work3 ;GCDADR
call idivIIdisi
cmul -1,0
add [calcsp],unitbyte
ret
lcmsub0:
mov word ptr [si],0
mov word ptr [si+unitbyte],0
add [calcsp],unitbyte
ret
code ends
code2 segment public
assume cs:code2,ds:data
public ahedsp2,backsp2,stringmember
public farStr$ent,str$packsub,str$prntax,str$prnteax
extrn prchr2:near,prspc2:near
extrn store_si2Z:near,monicin:near
extrn lcoeffin:near,ccoeffin:near,modmulin:near
extrn GET_WORLD_X:near,GET_WORLD_Y:near
extrn farSETFNAME:far
extrn str$poly:near,str$modpoly:near
; extrn gettime100:near
; extrn farARCTAN:far,farSQRTIN:far
extrn farADDIN:far,farSUBIN:far
; extrn readbin:near,writebin:near
if JAPANESE
extrn kanji1st2:near
endif
extrn dotcolor:near ;,gxxfer:near,gyxfer:near
func3other:
add al,0aeh
cmp al,91h ;polymod
jne func3synerr
jmp funcpolymod
func3synerr:
jmp far ptr synerr
func3ilgerr:
jmp far ptr ilgerr
func3ovrerr:
jmp far ptr ovrerr
func3main:
INC BP ;inc pointer
MOV AL,[BP]
INC BP
SUB AL,0aeH
jb func3other
CMP AL,51H ;51H=FfH-aeH
JA FUNC3SYNERR
XOR BX,BX
MOV BL,AL
SHL BX,1
JMP CS:FUNC_TBL3[BX]
EVEN
FUNC_TBL3 label word
dw cpu_ds,cpu_es
dw cpu_ax,cpu_bx,cpu_cx,cpu_dx
dw cpu_si,cpu_di,cpu_bp,cpu_flg
dw fcos,fsin,ftan,fatan
dw fsqrt,flog,flog2,flog10
DW dotcolor,instr,instr2,find2
dw numerator,denominator,posxin,posyin
dw hexin,upperin,lowerin,inpin
dw typein,attrib,varptr,scankey
dw zenkaku,hankaku,cutspace,cutleftspace
dw mapx,mapy,peekbyte,peekword
dw gposxin,gposyin,existin,degin
dw diffin,monicin,lcoeffin,ccoeffin
dw modmulin,verin,peekstring,lcm
dw getenv,modsqrt,keyup,keydown
dw bitor,bitand,bitxor,bitset
dw bitreset,bitreverse,bitcount,keyleft
dw keyright,floor,ceil,asin
dw acos,gettime100,sysIDin,exponent
dw significand,sizeof,linkpackin,pointset
dw polyconvin,polyrevin
;,readbin,writebin
;
;* cpu registers
;
cpu_ds:
jmp far ptr farcpu_ds
cpu_es:
jmp far ptr farcpu_es
cpu_ax:
jmp far ptr farcpu_ax
cpu_bx:
jmp far ptr farcpu_bx
cpu_cx:
jmp far ptr farcpu_cx
cpu_dx:
jmp far ptr farcpu_dx
cpu_si:
jmp far ptr farcpu_si
cpu_di:
jmp far ptr farcpu_di
cpu_bp:
jmp far ptr farcpu_bp
cpu_flg:
jmp far ptr farcpu_flg
;
;* polynomial conversion
;
polyconvin:
jmp far ptr farpolyconvin
;
;* polynomial reverse order
;
polyrevin:
jmp far ptr farpolyrevin
;
;* binary file read write
;
;readbin:
; jmp far ptr farreadbin
;writebin:
; jmp far ptr farwritebin
;
;
;* link pack
;
linkpackin:
jmp far ptr linkpack
;
;* system ID
;
sysIDin:
call far ptr farKakko_AX
or ax,ax
jz countryID
dec ax
jz machineID
dec ax
jz cpuID
jmp func3ilgerr
countryID:
; if JAPANESE
; mov ax,51h
; jmps sysID60
; else
mov dx,[calcsp]
mov ax,3800h
int 21h
mov ax,bx
jmps sysID50
; endif
cpuID:
mov ax,[machinetype]
jmps sysID50
machineID:
mov ax,[machinetype]
mov al,ah
sysID50:
xor ah,ah
sysID60:
mov si,[calcsp]
mov word ptr [si],1
mov [si+2],ax
jmp far ptr returnadr
;
; * floor
;
floor:
jmp far ptr floorin
;
; * ceil
;
ceil:
jmp far ptr ceilin
;
; * bitcount
;
bitcount:
call far ptr farkakko
mov si,[calcsp]
lodsw
test ah,LENMASKHIGHCPL
jnz bitcountilgerr ;must be non-negative integer
or ax,ax
jz bitcountret ;if 0
mov bx,ax
xor dx,dx
bitcount10:
lodsw
mov cx,16 ;16 bits
bitcount20:
shl ax,1
adc dx,0
myloop bitcount20
dec bx
jnz bitcount10
mov si,[calcsp]
mov word ptr [si],1
mov [si+2],dx
bitcountret:
jmp far ptr returnadr
bitcountilgerr:
jmp func3ilgerr
;
; * bitreverse
;
bitreverse:
call bitsetsub ;target is (ax-1)*16 + ch-th bit
mov di,[calcsp]
mov bx,[di]
cmp ax,bx
ja bitsethigher ;set it
sub bx,ax
shl ax,1
add di,ax
mov ax,1
mov cl,ch
rol ax,cl
xor [di],ax
jmp bitreset30
;
; * bitreset
;
bitreset:
call bitsetsub ;target is (ax-1)*16 + ch -thbit
mov di,[calcsp]
mov bx,[di]
cmp ax,bx
ja bitsetret ;already reset
sub bx,ax
shl ax,1
add di,ax
mov ax,0fffeh
mov cl,ch
rol ax,cl
and [di],ax
bitreset30:
or bx,bx
jnz bitsetret
mov si,[calcsp]
mov cx,[si]
xor ax,ax
std
repe scasw
cld
je bitreset50
inc cx
bitreset50:
mov [si],cx
jmp bitsetret
;
; * bitset
;
bitset:
call bitsetsub ;target is (ax-1)*16 + ch -thbit
mov di,[calcsp]
mov bx,[di]
cmp ax,bx
ja bitsethigher
shl ax,1
add di,ax
mov ax,1
mov cl,ch
rol ax,cl
or [di],ax
bitsetret:
jmp far ptr returnadr
bitsethigher:
mov [di],ax ;new length
inc bx
add di,bx
add di,bx
mov dx,cx ;memo shift count
mov cx,ax
sub cx,bx
xor ax,ax
rep stosw
mov ax,1
mov cl,dh
rol ax,cl
mov [di],ax
jmp bitsetret
bitsetsub:
call far ptr farget_AX
push ax
cmp byte ptr [bp],0c2h ;code of ,
jne get2intssynerr
inc bp
call far ptr farkakko
mov si,[calcsp]
lodsw
test ah,LENMASKHIGHCPL
jnz get2intsilgerr ;must be positive integer
pop ax
mov ch,al ;memo lower
and ch,0fh
mov cl,4
shr ax,cl ;now target = ch-th bit of [2*ax]
inc ax
cmp ax,limitword
ja bitsetilgerr
ret
bitsetilgerr:
jmp func3ilgerr
;
; * bitor
;
bitor:
call get2ints
mov si,[calcsp]
lea di,[si+unitbyte]
mov [calcsp],di
mov dx,[si]
add si,2
mov bx,[di]
cmp bx,dx ;bx(di):1st dx(si):2nd
jbe bitor50 ;2nd longer
; mov [di],bx
add di,2
mov cx,dx
bitor10:
jcxz bitor30
bitor20:
lodsw
or [di],ax
add di,2
myloop bitor20
bitor30:
jmps bitorret
bitor50:
mov [di],dx
add di,2
mov cx,bx
jcxz bitor70
bitor60:
lodsw
or [di],ax
add di,2
myloop bitor60
bitor70:
mov cx,dx
sub cx,bx
rep movsw
bitorret:
jmp far ptr returnadr
;
; * bitand
;
bitand:
call get2ints
mov si,[calcsp]
lea di,[si+unitbyte]
mov [calcsp],di
mov dx,[si]
add si,2
mov bx,[di]
cmp bx,dx ;bx(di):1st, dx(si):2nd
jbe bitand10 ;1st shorter
mov [di],dx
mov bx,dx
bitand10:
add di,2
mov cx,bx
jcxz bitandret ;if = 0
bitand20:
lodsw
and [di],ax
add di,2
myloop bitand20
mov cx,bx
sub di,2
xor ax,ax
std
repe scasw
cld
je bitand30
inc cx
bitand30:
mov di,[calcsp]
mov [di],cx
bitandret:
jmp far ptr returnadr
;
; * bitxor
;
bitxor:
call get2ints
mov si,[calcsp]
lea di,[si+unitbyte]
mov [calcsp],di
mov dx,[si]
add si,2
mov bx,[di]
cmp bx,dx ;bx(di):1st dx(si):2nd
jbe bitxor50 ;2nd longer or equal
; mov [di],bx
add di,2
mov cx,dx
jcxz bitxorret
bitxor20:
lodsw
xor [di],ax
add di,2
myloop bitxor20
jmps bitxorret
bitxor50:
mov [di],dx ;new length?
add di,2
mov cx,bx
jcxz bitxor70
bitxor60:
lodsw
xor [di],ax
add di,2
myloop bitxor60
bitxor70:
mov cx,dx
sub cx,bx
jz bitxor80
rep movsw
bitxorret:
jmp far ptr returnadr
bitxor80:
mov cx,bx
sub di,2
xor ax,ax
std
repe scasw
cld
je bitxor90
inc cx
bitxor90:
mov di,[calcsp]
mov [di],cx
jmp bitxorret
get2ints:
call far ptr farformul
mov si,[calcsp]
lodsw
test ah,LENMASKHIGHCPL
jnz get2intsilgerr ;must be positive integer
cmp byte ptr [bp],0c2h ;code of ,
jne get2intssynerr
inc bp
call far ptr farkakko
mov si,[calcsp]
lodsw
test ah,LENMASKHIGHCPL
jnz get2intsilgerr ;must be positive integer
ret
get2intsilgerr:
jmp func3ilgerr
get2intssynerr:
jmp func3synerr
comment %
;
; * xmax
; maximum column position
; usually 79
;
xmaxin:
call ahedsp2
mov ax,word ptr [chars1]
dec ax
mov word ptr [si],1
mov [si+2],ax
jmp far ptr returnadr
;
; * ymax
; maximum row position
;
ymaxin:
call ahedsp2
mov ax,word ptr [btmline]
dec ax
mov word ptr [si],1
mov [si+2],ax
jmp far ptr returnadr
%
;
; * key code of cursor up
;
keyup:
call ahedsp2
mov word ptr [si],1
if FLG98+FLGFMR
mov word ptr [si+2],5
endif
if FLGIBMTOS
mov word ptr [si+2],72
endif
jmp far ptr returnadr
;
; * key code of cursor down
;
keydown:
call ahedsp2
mov word ptr [si],1
if FLG98+FLGFMR
mov word ptr [si+2],24
endif
if FLGIBMTOS
mov word ptr [si+2],80
endif
jmp far ptr returnadr
;
; * key code of cursor left
;
keyleft:
call ahedsp2
mov word ptr [si],1
if FLG98+FLGFMR
mov word ptr [si+2],19
endif
if FLGIBMTOS
mov word ptr [si+2],75
endif