Classic Computer Magazine Archive PROGRAM LISTING: 84-11/WINDOWS2.ASM


0100 ; WINDOWS
0110 ; BY DAVE CULBERTSON
0120 ; ANTIC MAGAZINE
0130 ; ������Ӡ
0140 SCRN =  $CB     ;Beg Adr of window
0150 ASTR =  $CD     ;Adr of data string
0160 OFFS =  $0600   ;Offset into screen
0170 ; (upper left corner of box)
0180 ; �������Ԡ������Ԡ���çӠ
0190 ELEM =  $CF     ;# of elements
0200 ELEW =  $D1     ;Element width
0210 ELEO =  $0602   ;Element offset
0220 ; (Upper left corner of element)
0230 ;
0240     *=  $0600   ; RELOCATABLE
0250     PLA         ;Get # OF Prams off stack
0260 ; ���Ԡ������Ӡ�Ơ��������Ǡ
0270     PLA 
0280     STA ASTR+1
0290     PLA 
0300     STA ASTR
0310 ; ���Ԡ�����Ԡ���͠��Ǡ�Ơ�����Π
0320     PLA 
0330     STA OFFS+1
0340     PLA 
0350     STA OFFS
0360 ; ���Ԡ���Ơ�������Ӡ��Ҡ�����נ
0370     PLA 
0380     STA ELEM+1
0390     PLA 
0400     STA ELEM
0410 ; ���Ԡ������Ԡ����Ƞ
0420     PLA 
0430     PLA 
0440     STA ELEW
0450 ; ���Ԡ������Ԡ�����Ԡ
0460     PLA 
0470     STA ELEO+1
0480     PLA 
0490     STA ELEO
0500 ; ������̠��ԭ�Р
0510     LDA $58     ;Adr OF S.M. (Lo)
0520     STA SCRN
0530     LDA $59     ;Adr of S.M. (Hi)
0540     STA SCRN+1
0550 ; ���Ġ�����Ԡ�Ϡ���Π���Š
0560 ;Initially this routine sets-up
0570 ;the upper left corner of the
0580 ;window.
0590 B0  CLC 
0600     LDA SCRN
0610     ADC OFFS
0620     STA SCRN
0630     LDA SCRN+1
0640     ADC OFFS+1
0650     STA SCRN+1
0660 ; ���Р�����Π�������Ǡ
0670 C1  LDY #0      ;Width Counter
0680 C2  LDA (SCRN),Y
0690     TAX 
0700     LDA (ASTR),Y
0710     STA (SCRN),Y
0720     TXA 
0730     STA (ASTR),Y
0740     INY 
0750     CPY ELEW
0760     BNE C2
0770 ; �����ˠ��Ҡ������Ҡ������Ԡ
0780     LDA #0      ;Check Lo Byte.
0790     DEC ELEM    ;Sub 1.
0800     CMP ELEM    ;Is it zero?
0810     BNE C3      ;No then C3.
0820     CMP ELEM+1  ;Is Hi byte zero?
0830     BEQ EX      ;Yes - exit.
0840     DEC ELEM+1  ;No then sub 1.
0850 ;�����ؠ�����Ǡ��Ҡ���Ԡ������Ԡ
0860 C3  CLC 
0870     TYA         ;Add index to
0880     ADC ASTR    ;string pointer.
0890     STA ASTR
0900     BCC D0
0910     INC ASTR+1
0920 ;�����Š�����Π������Ҡ
0930     CLC 
0940 D0  LDA SCRN    ;  Then Add
0950     ADC ELEO
0960     STA SCRN    ;  ELEO to SCRN
0970     LDA SCRN+1
0980     ADC ELEO+1
0990     STA SCRN+1
1000     CLC         ;Go do next Element.
1010     BCC C1
1020 ;���̠���Š�����Π�Ϡ���à
1030 EX  RTS 

Back to previous page