Category : BASIC Source Code
Archive   : QB_CODE.ZIP
Filename : INCDEC.ASM

 
Output of file : INCDEC.ASM contained in archive : QB_CODE.ZIP
;
; INCDEC.ASM - For the QuickBASIC Toolbox
; Increment & Decrement Functions
;


INC_DEC_TEXT segment para public 'CODE'
assume cs:INC_DEC_TEXT

public iinc,idec,linc,ldec

;
; IINC Subprogram
;
iinc proc far
intptr equ <6[bp]>
push bp ;Save BP
mov bp,sp ;Point it to the stack
mov bx,intptr ;BX=Integer pointer
inc word ptr [bx] ;Bump the integer
pop bp ;Restore BP
ret 2 ;Return and clean up the stack
iinc endp

;
; IDEC Subprogram
;
idec proc far
intptr equ <6[bp]>
push bp ;Save BP
mov bp,sp ;Point it to the stack
mov bx,intptr ;BX=Integer pointer
dec word ptr [bx] ;Decrement the integer
pop bp ;Restore BP
ret 2 ;Return and clean up the stack
idec endp

;
; LINC Subprogram
;
linc proc far
intptr equ <6[bp]>
push bp ;Save BP
mov bp,sp ;Point it to the stack
mov bx,intptr ;BX=Long integer pointer
inc word ptr [bx] ;Bump the LSW
jnz linc1 ;Jump if it didn't roll over
inc word ptr 2[bx] ;Bump the MSW
linc1: pop bp ;Restore BP
ret 2 ;Return and clean up the stack
linc endp

;
; LDEC Subprogram
;
ldec proc far
intptr equ <6[bp]>
push bp ;Save BP
mov bp,sp ;Point it to the stack
mov bx,intptr ;BX=Long integer pointer
dec word ptr [bx] ;Decrement the LSW
cmp word ptr [bx],0ffffh ;Jump if it
jne ldec1 ; didn't roll over
dec word ptr 2[bx] ;Decrement the MSW
ldec1: pop bp ;Restore BP
ret 2 ;Return and clean up the stack
ldec endp

INC_DEC_TEXT ends

end


  3 Responses to “Category : BASIC Source Code
Archive   : QB_CODE.ZIP
Filename : INCDEC.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/