home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Unsorted BBS Collection
/
thegreatunsorted.tar
/
thegreatunsorted
/
programming
/
asm_programming
/
AO2.LST
< prev
next >
Wrap
File List
|
1990-10-03
|
7KB
|
218 lines
Microsoft (R) Macro Assembler Version 5.10 10/3/90 23:11:50
Page 1-1
; ASCII Organ II (Version 2: bypasses DOS)
= 0042 timer equ 42h
= 0061 speaker equ 61h
= 004F sponmsk equ 4fh
= 004C spofmsk equ 4ch
= 00B6 settim equ 0b6h
= 0001 termkey equ 1
= 0060 keyport equ 60h
doscall macro x
mov ah,x
int 21h
endm
pout macro x,y
mov al,y
out x,al
endm
0000 code segment
0100 org 100h
assume cs:code
0100 EB 1E 90 start: jmp begin ; bypasses vari
able storage
;---- Variable storage ----
0103 41 74 74 65 6E 74 msg db 'Attention: <ESC> to quit$'
69 6F 6E 3A 20 3C
45 53 43 3E 20 74
6F 20 71 75 69 74
24
011C 00000000 oldvect dd 0 ; define double
word (4 bytes)
; for storage..
.
; Start of Program
0120 BA 0103 R begin: mov dx,offset msg
doscall 9
0123 B4 09 1 mov ah,9
0125 CD 21 1 int 21h
0127 2B C0 sub ax,ax ; establish add
ressing area
0129 8E D8 mov ds,ax ; interupt vect
or
012B BE 0024 mov si,9*4 ; mov si,36
012E B9 0004 mov cx,4 ; 2.0 makes a c
all here
0131 BF 011C R mov di,offset oldvect
0134 FC cld ; in precaution
Microsoft (R) Macro Assembler Version 5.10 10/3/90 23:11:50
Page 1-2
0135 F3/ A4 rep movsb
0137 0E push cs ; set DS = CS
0138 1F pop ds
0139 BA 0147 R mov dx,offset kbdintarget
013C B0 09 mov al,9 ; make interru
pt 9 point
doscall 25h ; to kbdintarg
et
013E B4 25 1 mov ah,25h
0140 CD 21 1 int 21h
0142 BA 0192 R mov dx,offset lastin + 5
0145 CD 27 int 27h ; end, make res
ident
; execute with each stroke of a key
0147 kbdintarget:
0147 FB sti ; timer interru
pt
0148 50 push ax ; save ax
0149 E4 60 in al,keyport ; read key
014B 3C 80 cmp al,80h ; key > 80h?
014D 73 3D jnb exit ; if yes, jump.
..
014F 3C 01 cmp al,termkey ; <esc> key?
0151 74 1D je lastime ; if yes, jump.
..
0153 50 push ax ; store key
pout timer+1,settim
0154 B0 B6 1 mov al,settim
0156 E6 43 1 out timer+1,al
0158 2A C0 sub al,al ; let AL = 0
015A E6 42 out timer,al ; send divisor,
LSB first
015C 58 pop ax ; MSB of diviso
r=value of key
015D E6 42 out timer,al ; timer control
s tone
pout speaker,sponmsk ; play note
015F B0 4F 1 mov al,sponmsk
0161 E6 61 1 out speaker,al
0163 B8 2000 mov ax,2000h ; wait loop
0166 48 repeat: dec ax
0167 75 FD jne repeat
pout speaker,spofmsk
0169 B0 4C 1 mov al,spofmsk
016B E6 61 1 out speaker,al
016D EB 1D 90 jmp exit
0170 lastime: ; resume keyboa
rd vector
0170 1E push ds ; store all reg
Microsoft (R) Macro Assembler Version 5.10 10/3/90 23:11:50
Page 1-3
isters in stack
0171 06 push es ;
0172 56 push si ;
0173 57 push di
0174 51 push cx
0175 0E push cs
0176 1F pop ds ; let DS = CS
0177 2B C0 sub ax,ax ; establish add
ressing area
0179 8E C0 mov es,ax ; interrupt vec
tor
017B BF 0024 mov di,9*4 ; move program
storage
017E BE 011C R mov si,offset oldvect ; into int. v
ector area
0181 B9 0004 mov cx,4
0184 FC cld
0185 F3/ A4 rep movsb ; return former
keyboard interrupt
0187 59 pop cx ; vector and re
gisters
0188 5F pop di ; in order oppo
site of push...
0189 5E pop si
018A 07 pop es
018B 1F pop ds
018C 58 exit: pop ax
018D 2E: FF 2E 011C R lastin: jmp [oldvect] ; jump former r
out. keyb. int.
0192 code ends
end start
Microsoft (R) Macro Assembler Version 5.10 10/3/90 23:11:50
Symbols-1
Macros:
N a m e Lines
DOSCALL . . . . . . . . . . . . 2
POUT . . . . . . . . . . . . . . 2
Segments and Groups:
N a m e Length Align Combine Class
CODE . . . . . . . . . . . . . . 0192 PARA NONE
Symbols:
N a m e Type Value Attr
BEGIN . . . . . . . . . . . . . L NEAR 0120 CODE
EXIT . . . . . . . . . . . . . . L NEAR 018C CODE
KBDINTARGET . . . . . . . . . . L NEAR 0147 CODE
KEYPORT . . . . . . . . . . . . NUMBER 0060
LASTIME . . . . . . . . . . . . L NEAR 0170 CODE
LASTIN . . . . . . . . . . . . . L NEAR 018D CODE
MSG . . . . . . . . . . . . . . L BYTE 0103 CODE
OLDVECT . . . . . . . . . . . . L DWORD 011C CODE
REPEAT . . . . . . . . . . . . . L NEAR 0166 CODE
SETTIM . . . . . . . . . . . . . NUMBER 00B6
SPEAKER . . . . . . . . . . . . NUMBER 0061
SPOFMSK . . . . . . . . . . . . NUMBER 004C
SPONMSK . . . . . . . . . . . . NUMBER 004F
START . . . . . . . . . . . . . L NEAR 0100 CODE
TERMKEY . . . . . . . . . . . . NUMBER 0001
TIMER . . . . . . . . . . . . . NUMBER 0042
@CPU . . . . . . . . . . . . . . TEXT 0101h
@FILENAME . . . . . . . . . . . TEXT ao2
@VERSION . . . . . . . . . . . . TEXT 510
Microsoft (R) Macro Assembler Version 5.10 10/3/90 23:11:50
Symbols-2
102 Source Lines
112 Total Lines
24 Symbols
47906 + 280712 Bytes symbol space free
0 Warning Errors
0 Severe Errors