I want to draw a pacman in assembly

I am trying to draw a pacman sprite in assembly, and I have a function that is working well, the code is here:

DEFINE_LINE            EQU 600AH      ; address of the command to define the line
DEFINE_COLUMN          EQU 600CH      ; address of the command to define the column
DEFINE_PIXEL           EQU 6012H      ; address of the command to write a pixel
CLEAR_NOTICE           EQU 6040H      ; address of the command to clear the "no scenario selected" notice
CLEAR_SCREEN           EQU 6002H      ; address of the command to clear all drawn pixels
SELECT_BACKGROUND_SCENARIO EQU 6042H  ; address of the command to select a background image

; map limits
MIN_COLUMN             EQU 0         ; number of the leftmost column the object can occupy
MAX_COLUMN             EQU 63        ; number of the rightmost column the object can occupy
DELAY                  EQU 400H      ; delay to limit the movement speed of the character

LINE                   EQU 14        ; character line (middle of the screen)
COLUMN                 EQU 31        ; character column (middle of the screen)
PACMAN_LENGTH          EQU 4
PACMAN_HEIGHT          EQU 5

WHITE                  EQU 0FFFFH    ; white color
YELLOW                 EQU 0FFF0H
GREEN                  EQU 0F090H 
BLUE                   EQU 0F36FH    ; blue color

; *********************************************************************************
; * Data
; *********************************************************************************
PLACE       1000H
stack_:
    STACK 100H          ; space reserved for the stack
                        ; (200H bytes, as they are 100H words)
initial_SP:             ; this is the address (1200H) with which the SP must be
                        ; initialized. The 1st return address will be stored
                        ; at 11FEH (1200H-2)

DEF_PACMAN:             ; table that defines the Pacman (color, width, pixels)
    WORD PACMAN_LENGTH
    WORD 0,YELLOW,YELLOW,0
    WORD YELLOW,YELLOW,YELLOW,YELLOW
    WORD YELLOW,0,0,0
    WORD YELLOW,YELLOW,YELLOW,YELLOW
    WORD 0,YELLOW,YELLOW,0
    


; *********************************************************************************
; * Code
; *********************************************************************************
PLACE   0               ; the code must start at 0000H
start:

    MOV  SP, initial_SP  ; initializes SP to the word following
                         ; the last one in the stack
    
    MOV  [CLEAR_NOTICE], R1  ; clears the "no scenario selected" notice (the value of R1 is not relevant)
    MOV  [CLEAR_SCREEN], R1  ; clears all drawn pixels (the value of R1 is not relevant)
    MOV  R1, 1            ; background scenario number 0
    MOV  [SELECT_BACKGROUND_SCENARIO], R1  ; selects the background scenario
    
    MOV  R1, LINE          ; line where to start drawing the sprite
    MOV  R2, COLUMN        ; column of where to start drawing the sprite
    MOV R0,1 ; Set the draw lines to mode 1( mode 1 writes , mode 0 erases)
    CALL draw_pacman
    
    MOV R7,1
    

end:
    JMP  end                 ; end program

draw_pacman:
    
    MOV  R4, DEF_PACMAN
    ADD  R4, 2              ; address of the color of the 1st pixel (2 because the width is a word)
    MOV  R5, PACMAN_HEIGHT ; get character height 
    
    MOV R7,PACMAN_LENGTH; put the character length in R7
    MOV R6,R7
    MOV R8,COLUMN
    CALL draw_lines
    RET

change_line:
SUB R5,1                    ; minus one line to treat
JZ stop                     ; if you have already gone through the entire height of the sprite, stop drawing.
ADD R1,1                    ; change line 
MOV R2,R8                   ; reset column position 
MOV R6,R7                   ; reset loop 
draw_lines: 
    CMP R0,0                ; check if it's in write mode
    JNZ changecolor
                            ; draw the character pixels from the table
    MOV R3,0
    JMP continue
    changecolor:
    MOV R3, [R4]            ; get the color of the next character pixel
    
    continue:
    CALL write_pixel        ; write each character pixel
    ADD R4, 2               ; address of the color of the next pixel (2 because each pixel color is a word)
    ADD  R2, 1              ; next column
                            ; minus one column to treat
    SUB R6,1
    JZ change_line
    
    
    JNZ draw_lines          ; continue until you cover the entire width of the object
stop: 
    RET


write_pixel:
    
    MOV  [DEFINE_LINE], R1    ; select the line
    MOV  [DEFINE_COLUMN], R2  ; select the column
    MOV  [DEFINE_PIXEL], R3   ; change the color of the pixel in the selected line and column
    RET




Here is what this code does

The function draw_pacman sets R1 and R2 as the X and Y coordinates where we’ll start drawing the Pacman, and it starts reading the DEF_PACMAN pixel table , then draws the sprite line by line, changing line every 4 pixels. It works, but I would like to make the table with bytes like this:

DEF_PACMAN:             ; table that defines the Pacman (color, width, pixels)
   ; 1 is supposed to be YELLOW, 0 transparent and 2 can either be transparent or yellow , changing from time to time on a loop (Pacman mouth opening and closing) 
   WORD PACMAN_LENGTH
   WORD SCALE ; if i change the scale to 2 per example I want the pacman to double its size
   BYTE 0,1,1,0
   BYTE 1,1,1,1
   BYTE 1,2,2,2
   BYTE 1,1,1,1
   BYTE 0,1,1,0
   

I know this is possible because I saw it in a YouTube video but I didn’t understand how I could implement this in my function. This is assembly code that is being run in a simulator PEPE-16. Any tips on optimization would also be appreciated.

enter code here

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật