home *** CD-ROM | disk | FTP | other *** search
- \ SEDCODE.SEQ The Assembly code needed for SED by Tom Zimmer
-
- only forth also hidden definitions also
-
- code tb: ( W -- tsegb W )
- pop ax
- mov dx, tsegb
- 2push
- end-code
-
- code tl: ( W -- lseg W )
- pop ax
- mov dx, lseg
- 2push
- end-code
-
- code ?exit ( f1 -- ) \ exit from definition on boolean f1.
- pop ax
- or ax, ax
- 0<> if
- mov ip, 0 [rp]
- inc rp
- inc rp
- then
- next
- end-code
-
- code getdiskfree \ return free space from disk
- ( dv --- avail.clusters bytes/sec secs/cluster )
- mov ah, # 54
- pop dx
- int 33
- push bx
- push cx
- 1push
- end-code
-
- code >lineptr ( n1 --- a1 )
- pop ax
- shl ax, # 1
- 1push
- end-code
-
- code tl:@ ( a1 -- n1 )
- pop bx mov ds, lseg
- mov ax, 0 [bx]
- mov bx, cs mov ds, bx
- 1push end-code
-
- code tl:! ( n adr -- )
- pop bx mov ds, lseg
- pop ax mov 0 [bx], ax
- mov bx, cs mov ds, bx
- NEXT END-CODE
-
- code #linedata ( n1 --- a1 n2 ) \ n1 = line, a1,n2 = addr & len
- pop bx \ get line number
- shl bx, # 1 \ convert to word offset
- mov ds, lseg \ set DS to Linelist segment
- mov ax, 0 [bx] \ get line address
- push ax \ push it
- mov dx, ax \ save to subtract later
- mov ax, 2 [bx] \ get next list address
- sub ax, dx \ subtract to get line length
- mov bx, cs
- mov ds, bx \ restore DS
- 1push end-code
-
- code clipline ( a1 n1 --- a2 n3 )
- mov bx, ' screenchar >body \ get the value of screenchar
- pop cx
- pop dx
- mov ax, # 39
- begin
- cmp bx, # 77
- > while
- sub bx, ax
- sub cx, ax
- add dx, ax
- repeat
- push dx
- push cx
- next
- end-code
-
-
- code qmod ( n1 n1 -- Remainder ) \ a quick modulus operator
- pop bx mov dx, # 0
- pop ax
- div bx push dx
- next
- end-code
-
- only forth also definitions
-