Changeset 4f508e6 in buchla-68k for vlib/vputc.s
- Timestamp:
- 07/01/2017 02:34:46 PM (7 years ago)
- Branches:
- master
- Children:
- 08e1da1
- Parents:
- f40a309
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vlib/vputc.s
rf40a309 r4f508e6 1 *------------------------------------------------------------------------------2 *vputc.s -- store a character and attributes in video RAM3 *Version 3 -- 1987-03-30 -- D.N. Lynx Crowe4 *(c) Copyright 1987 -- D.N. Lynx Crowe5 *------------------------------------------------------------------------------6 * 7 *vputc(sbase, row, col, c, attrib)8 * unsigned int *sbase, row, col, c, attrib;9 * 10 *Stores character c at (row,col) in sbase with11 *attribute value attrib.12 *------------------------------------------------------------------------------13 * 1 | ------------------------------------------------------------------------------ 2 | vputc.s -- store a character and attributes in video RAM 3 | Version 3 -- 1987-03-30 -- D.N. Lynx Crowe 4 | (c) Copyright 1987 -- D.N. Lynx Crowe 5 | ------------------------------------------------------------------------------ 6 7 | vputc(sbase, row, col, c, attrib) 8 | unsigned int |sbase, row, col, c, attrib; 9 10 | Stores character c at (row,col) in sbase with 11 | attribute value attrib. 12 | ------------------------------------------------------------------------------ 13 14 14 .text 15 * 15 16 16 .xdef _vputc 17 * 18 _vputc: link a6,#0 *Link stack frame pointer19 clr.l d0 *Clear out d020 move.w 12(a6),d0 *Get row21 lsl.l #6,d0 *Multiply by 64 (shift left 6)22 move.w 14(a6),d1 *Get col23 andi.l # $0000003F,d1 *Mask down to 6 bits24 or.l d1,d0 *OR into d0 to get char. #25 move.w d0,d1 * Develop cw = (cn/2)*6 in d126 andi.l # $FFFFFFFE,d1 *...27 move.l d1,d2 *...28 lsl.l #1,d1 *...29 add.l d2,d1 *...30 add.l 8(a6),d1 *Add sbase to cw31 movea.l d1,a0 *a0 points at the word with the char.32 btst.l #0,d0 *Odd char. location ?33 bne vputc1 *Jump if so34 * 35 move.w 16(a6),d0 *Get ch36 andi.w # $00FF,d0 *Mask off garbage bits37 move.w (a0),d1 *Get word from video RAM38 andi.w # $FF00,d1 *Mask off old even character39 or.w d0,d1 *OR in the new character40 move.w d1,(a0)+ *Store the updated word in video RAM41 move.w 18(a6),(a0) *Store new attribute word in video RAM42 * 43 vputcx: unlk a6 *Unlink the stack frame44 rts *Return to caller45 * 46 vputc1: move.w 16(a6),d0 *Get ch47 lsl.w #8,d0 *Shift to high (odd) byte48 move.w (a0),d1 *Get word from video RAM49 andi.w # $00FF,d1 *Mask off old odd character50 or.w d0,d1 *OR in the new character51 move.w d1,(a0)+ *Store the updated word in video RAM52 addq.l #2,a0 *Point at the attribute word53 move.w 18(a6),(a0) *Store new attributes in video RAM54 bra vputcx *Done -- go return to caller55 * 17 18 _vputc: link a6,#0 | Link stack frame pointer 19 clr.l d0 | Clear out d0 20 move.w 12(a6),d0 | Get row 21 lsl.l #6,d0 | Multiply by 64 (shift left 6) 22 move.w 14(a6),d1 | Get col 23 andi.l #0x0000003F,d1 | Mask down to 6 bits 24 or.l d1,d0 | OR into d0 to get char. # 25 move.w d0,d1 | Develop cw = (cn/2)|6 in d1 26 andi.l #0xFFFFFFFE,d1 | ... 27 move.l d1,d2 | ... 28 lsl.l #1,d1 | ... 29 add.l d2,d1 | ... 30 add.l 8(a6),d1 | Add sbase to cw 31 movea.l d1,a0 | a0 points at the word with the char. 32 btst.l #0,d0 | Odd char. location ? 33 bne vputc1 | Jump if so 34 35 move.w 16(a6),d0 | Get ch 36 andi.w #0x00FF,d0 | Mask off garbage bits 37 move.w (a0),d1 | Get word from video RAM 38 andi.w #0xFF00,d1 | Mask off old even character 39 or.w d0,d1 | OR in the new character 40 move.w d1,(a0)+ | Store the updated word in video RAM 41 move.w 18(a6),(a0) | Store new attribute word in video RAM 42 43 vputcx: unlk a6 | Unlink the stack frame 44 rts | Return to caller 45 46 vputc1: move.w 16(a6),d0 | Get ch 47 lsl.w #8,d0 | Shift to high (odd) byte 48 move.w (a0),d1 | Get word from video RAM 49 andi.w #0x00FF,d1 | Mask off old odd character 50 or.w d0,d1 | OR in the new character 51 move.w d1,(a0)+ | Store the updated word in video RAM 52 addq.l #2,a0 | Point at the attribute word 53 move.w 18(a6),(a0) | Store new attributes in video RAM 54 bra vputcx | Done -- go return to caller 55 56 56 .end
Note:
See TracChangeset
for help on using the changeset viewer.