Skip to content

Instantly share code, notes, and snippets.

@Guevara-chan
Last active March 2, 2017 00:14
Show Gist options
  • Save Guevara-chan/7c4904f0a7314ba90a560801ea14d944 to your computer and use it in GitHub Desktop.
Save Guevara-chan/7c4904f0a7314ba90a560801ea14d944 to your computer and use it in GitHub Desktop.
Procedure RGB2Gray(RGB)
! MOVZX EAX, byte [p.v_RGB]
! MOVZX EBX, byte [p.v_RGB+1]
! MOVZX ECX, byte [p.v_RGB+2]
! XOR DX, DX
! ADD AX, BX
! ADD AX, CX
! MOV CX, 3
! DIV CX
ProcedureReturn
EndProcedure
Procedure Gray2RGB(Level.a)
!XOR EAX, EAX
!MOV byte AH, [p.v_Level]
!MOV byte AL, AH
!SHL EAX, 8
!MOV AL, AH
ProcedureReturn
EndProcedure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment