; Turn on power to speaker magnet
OR AL,00000010b ; binary is useful for individual bit references
OUT 61h,AL
; Wait for a short time
; Turn off power to speaker magnet
AND AL,1111101b
OUT 61h,AL
; Wait again and then repeat
SUB AX,AX ;set DS: to Interrupt Vector/BIOS Data area
MOV DS,AX
MOV DX,[0408h] ;printer adaptor base port # (data port)
MOV AX,CS ;restore DS: to this segment
MOV DS,AX
INC DX ;printer status port (always data port # +1)
IN AL,DX ;get status
AND AL,80h ;test for not busy
JZ P_BUSY ; -it was busy
DEC DX ;printer data port #
MOV AL,[BX] ;get char to print
OUT DX,AL ;put char on data port lines
INC DX ;printer control port (always data port # +2)
INC DX
MOV AL,00001101b ;strobe printer control port (on)
OUT DX,AL
MOV AL,00001100b ; (off)
OUT DX,AL