flat assembler
Message board for the users of flat assembler.

Index > MenuetOS > 32 bit menuet bootcode source code

Author
Thread Post new topic Reply to topic
turkosx



Joined: 27 Apr 2025
Posts: 2
turkosx 27 Apr 2025, 13:48
When I select 7 while examining the source code

pre_graph2:
cmp al,1 ; < 1 only if programmer error
jl gml0
cmp al,8 ; VGA modes?
jg sgml1
mov si,ax ;7
dec si ;6
shl si,4 ;96
add si,gr_table ;I didn't understand this part
mov bx,[si+0]
mov cx,[si+4]
mov dx,[si+8]
Post 27 Apr 2025, 13:48
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1149
Location: Russia
macomics 27 Apr 2025, 14:30
Code:
pre_graph2:
cmp al,1 ; < 1 only if programmer error
jl gml0
; al >= 1
cmp al,8 ; VGA modes?
jg sgml1
; 1 <= al <= 8
mov si,ax ; э [1 .. 8]
dec si ; э [0 .. 7]
shl si,4 ; si *= 16 => [0=0, 1=16, 2=32, ..., 7 = 112] -- offset from table
add si,gr_table ; table row address table(gr_table) + nrow(al) * rowsize(16)
mov bx,[si+0] ; bx = col[0]
mov cx,[si+4] ; cx = col[2]
mov dx,[si+8] ; dx = col[4]    
Post 27 Apr 2025, 14:30
View user's profile Send private message Reply with quote
turkosx



Joined: 27 Apr 2025
Posts: 2
turkosx 27 Apr 2025, 19:53
thanks
Post 27 Apr 2025, 19:53
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.