source: buchla-68k/vlib/vsetav.s@ e877e55

Last change on this file since e877e55 was 4f508e6, checked in by Thomas Lopatic <thomas@…>, 7 years ago

Converted assembly language files.

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[4f508e6]1| ------------------------------------------------------------------------------
2| vsetav.s -- set a character's attributes in video RAM
3| Version 1 -- 1988-10-11 -- D.N. Lynx Crowe
4| (c) Copyright 1988 -- D.N. Lynx Crowe
5| ------------------------------------------------------------------------------
6
7| vsetav(adr, row, col, atr, len)
8| unsigned int |adr, row, col, atr, len;
9
10| Sets attribute 'atr' at ('row', 'col') in the
11| full attribute text object at 'adr'
12| using a line length of 'len'.
13| ------------------------------------------------------------------------------
[f40a309]14 .text
[4f508e6]15
[f40a309]16 .xdef _vsetav
[4f508e6]17
18P_ADR = 8
19P_ROW = 12
20P_COL = 14
21P_ATR = 16
22P_LEN = 18
23
24_vsetav: link a6,#0 | Link stack frame pointer
25 move.w P_ROW(a6),d0 | Get row
26 mulu P_LEN(a6),d0 | Multiply by len
27 clr.l d1 | Clear out d1
28 move.w P_COL(a6),d1 | Get col
29 add.l d1,d0 | Add col into d0 to get char. #
30 move.l d0,d1 | Develop cw = (cn/2)|6 in d1
31 andi.l #0xFFFFFFFE,d1 | ...
32 move.l d1,d2 | ...
33 add.l d1,d1 | ...
34 add.l d2,d1 | ...
35 add.l P_ADR(a6),d1 | Add sbase to cw
36 movea.l d1,a0 | a0 points at the word with the char.
37 btst.l #0,d0 | Odd char. location ?
38 bne vsetav1 | Jump if so
39
40 addq.l #2,a0 | Point at the attribute word
41 bra vsetavx | Go set attribute
42
43vsetav1: addq.l #4,a0 | Point at the attribute word
44
45vsetavx: move.w P_ATR(a6),d0 | Get new attributes
46 or.w d0,(a0) | Set new attributes in video RAM
47 unlk a6 | Unlink the stack frame
48 rts | Return to caller
49
[f40a309]50 .end
Note: See TracBrowser for help on using the repository browser.