Advertisement
Little0Wen

BRITAIN FLAG in TASM

Nov 27th, 2022 (edited)
541
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
6502 TASM/64TASS 6.70 KB | Source Code | 0 0
  1. ;Britain Flag in TASM DOS-BOX compile with tlink as com file
  2. include graphics.h
  3.  
  4. .model small
  5.  
  6. code segment
  7. assume cs:code
  8. org 100h
  9. start:
  10.     ;Video Mode param: 03h - 80x45 text
  11.     Video_Mode 03h
  12.  
  13.     ;Reset cursor position to screen space origin
  14.     cursor_to 0, 0
  15.  
  16.     ;[filling the background] params: color, width, height
  17.     fill_bg 00010001b, 80, 24
  18.  
  19.     ;Reset cursor position to screen space origin
  20.     cursor_to 0, 0
  21.  
  22.     ;[here start the diagonal block]
  23.     mov cx, 11
  24.     mov al, 254
  25.     mov bl, 01110111b
  26.     Diagonal_BLock1:
  27.         push dx ;push dx to stack to save old register
  28.        
  29.         ;part here creates the 12x2 block
  30.         mov ah, 9h
  31.         int 10h
  32.         inc dh
  33.         mov ah, 2h
  34.         int 10h
  35.         mov ah, 9h
  36.         int 10h
  37.         ;added
  38.         mov ah, 9h
  39.         int 10h
  40.         inc dh
  41.         mov ah, 2h
  42.         int 10h
  43.         mov ah, 9h
  44.         int 10h
  45.  
  46.         pop dx ;retrieve dx
  47.         add dl , 4 ;x spacing
  48.         add dh, 1  ;y spacing
  49.         mov ah, 2h
  50.         int 10h
  51.  
  52.         ;Comparison to cut the line
  53.         cmp dh, 10
  54.         jne Diagonal_BLock1
  55.  
  56.     ;cursor position to screen space
  57.     cursor_to 0, 1
  58.  
  59.     ;[here start the diagonal Red block]
  60.     mov cx, 5
  61.     mov al, 254
  62.     mov bl, 01000100b
  63.     Diagonal_BLockR1:
  64.         push dx ;push dx to stack to save old register
  65.         ;part here creates the 12x2 block
  66.         mov ah, 9h
  67.         int 10h
  68.  
  69.         pop dx ;retrieve dx
  70.         add dl , 4 ;x spacing
  71.         add dh, 1  ;y spacing
  72.         mov ah, 2h
  73.         int 10h
  74.  
  75.         ;Comparison to cut the line
  76.         cmp dh, 10
  77.         jne Diagonal_BLockR1
  78.  
  79.     ;cursor position to screen space
  80.     cursor_to 69, 0
  81.  
  82.     ;[here start the diagonal block]
  83.     mov cx, 11
  84.     mov al, 254
  85.     mov bl, 01110111b
  86.     Diagonal_BLock2:
  87.         push dx ;push dx to stack to save old register
  88.        
  89.         ;part here creates the 12x2 block
  90.         mov ah, 9h
  91.         int 10h
  92.         inc dh
  93.         mov ah, 2h
  94.         int 10h
  95.         mov ah, 9h
  96.         int 10h
  97.         ;added
  98.         mov ah, 9h
  99.         int 10h
  100.         inc dh
  101.         mov ah, 2h
  102.         int 10h
  103.         mov ah, 9h
  104.         int 10h
  105.  
  106.         pop dx ;retrieve dx
  107.         sub dl , 4 ;x spacing
  108.         add dh, 1  ;y spacing
  109.         mov ah, 2h
  110.         int 10h
  111.  
  112.         ;Comparison to cut the line
  113.         cmp dh, 10
  114.         jne Diagonal_BLock2
  115.  
  116.  
  117.     ;cursor position to screen space
  118.     cursor_to 74, 0
  119.  
  120.     ;[here start the diagonal red block]
  121.     mov cx, 6
  122.     mov al, 254
  123.     mov bl, 01000100b
  124.     Diagonal_BLockR2:
  125.         push dx ;push dx to stack to save old register
  126.        
  127.         ;draw the line
  128.         mov ah, 9h
  129.         int 10h
  130.  
  131.         pop dx ;retrieve dx
  132.         sub dl , 4 ;x spacing
  133.         add dh, 1  ;y spacing
  134.         mov ah, 2h
  135.         int 10h
  136.  
  137.         ;Comparison to cut the line
  138.         cmp dh, 10
  139.         jne Diagonal_BLockR2
  140.  
  141.     ;cursor position to screen space
  142.     cursor_to 0, 23
  143.  
  144.     ;[here start the diagonal block]
  145.     mov cx, 11
  146.     mov al, 254
  147.     mov bl, 01110111b
  148.     Diagonal_BLock3:
  149.         push dx ;push dx to stack to save old register
  150.        
  151.         ;part here creates the 12x2 block
  152.         mov ah, 9h
  153.         int 10h
  154.         dec dh
  155.         mov ah, 2h
  156.         int 10h
  157.         mov ah, 9h
  158.         int 10h
  159.         ;added
  160.         mov ah, 9h
  161.         int 10h
  162.         dec dh
  163.         mov ah, 2h
  164.         int 10h
  165.         mov ah, 9h
  166.         int 10h
  167.  
  168.         pop dx ;retrieve dx
  169.         add dl , 4 ;x spacingm    
  170.         sub dh, 1  ;y spacing
  171.         mov ah, 2h
  172.         int 10h
  173.  
  174.         ;Comparison to cut the line
  175.         cmp dh, 10
  176.         jne Diagonal_BLock3
  177.  
  178.     ;cursor position to screen space
  179.     cursor_to 0, 23
  180.  
  181.     ;[here start the diagonal block]
  182.     mov cx, 6
  183.     mov al, 254
  184.     mov bl, 01000100b
  185.     Diagonal_BLockR3:
  186.         push dx ;push dx to stack to save old register
  187.        
  188.         ;part here creates the 12x2 block
  189.         mov ah, 9h
  190.         int 10h
  191.  
  192.         pop dx ;retrieve dx
  193.         add dl , 4 ;x spacingm    
  194.         sub dh, 1  ;y spacing
  195.         mov ah, 2h
  196.         int 10h
  197.  
  198.         ;Comparison to cut the line
  199.         cmp dh, 10
  200.         jne Diagonal_BLockR3
  201.  
  202.    
  203.     ;cursor position to screen space
  204.     cursor_to 69, 23
  205.  
  206.     ;[here start the diagonal block]
  207.     mov cx, 11
  208.     mov al, 254
  209.     mov bl, 01110111b
  210.     Diagonal_BLock4:
  211.         push dx ;push dx to stack to save old register
  212.        
  213.         ;part here creates the 12x2 block
  214.         mov ah, 9h
  215.         int 10h
  216.         dec dh
  217.         mov ah, 2h
  218.         int 10h
  219.         mov ah, 9h
  220.         int 10h
  221.         ;added
  222.         mov ah, 9h
  223.         int 10h
  224.         dec dh
  225.         mov ah, 2h
  226.         int 10h
  227.         mov ah, 9h
  228.         int 10h
  229.  
  230.         pop dx ;retrieve dx
  231.         sub dl , 4 ;x spacingm    
  232.         sub dh, 1  ;y spacing
  233.         mov ah, 2h
  234.         int 10h
  235.  
  236.         ;Comparison to cut the line
  237.         cmp dh, 10
  238.         jne Diagonal_BLock4
  239.  
  240.     ;cursor position to screen space
  241.     cursor_to 74, 22
  242.  
  243.     ;[here start the diagonal RED block]
  244.     mov cx, 6
  245.     mov al, 254
  246.     mov bl, 01000100b
  247.     Diagonal_BLockR4:
  248.         push dx ;push dx to stack to save old register
  249.        
  250.         ;part here creates the 12x2 block
  251.         mov ah, 9h
  252.         int 10h
  253.         mov cx, 5
  254.  
  255.         pop dx ;retrieve dx
  256.         sub dl , 4 ;x spacingm    
  257.         sub dh, 1  ;y spacing
  258.         mov ah, 2h
  259.         int 10h
  260.  
  261.         ;Comparison to cut the line
  262.         cmp dh, 10
  263.         jne Diagonal_BLockR4
  264.  
  265.  
  266.     ;move  cursor to x-35 to draw center line
  267.     cursor_to 35, 0
  268.  
  269.     ;[here starts the cross]
  270.     mov cx, 10
  271.     mov al, 254
  272.     mov bl, 01110111b
  273.     CenterLine:
  274.         mov ah, 2h
  275.         int 10h
  276.         mov ah, 9h
  277.         int 10h
  278.         inc dh
  279.         cmp dh,24
  280.         jne CenterLine
  281.  
  282.     cursor_to 0, 9
  283.  
  284.     mov cx, 80
  285.     mov al, 254
  286.     mov bl, 01110111b
  287.     MiddleLine:
  288.         mov ah, 2h
  289.         int 10h
  290.         mov ah, 9h
  291.         int 10h
  292.         inc dh
  293.         cmp dh,15
  294.         jne MiddleLine
  295.  
  296.     cursor_to 36, 0
  297.  
  298.     mov cx, 8
  299.     mov al, 254
  300.     mov bl, 01000100b
  301.     CenterLineR:
  302.         mov ah, 2h
  303.         int 10h
  304.         mov ah, 9h
  305.         int 10h
  306.         inc dh
  307.         cmp dh,24
  308.         jne CenterLineR
  309.  
  310.     cursor_to 0, 10
  311.  
  312.     mov cx, 80
  313.     mov al, 254
  314.     mov bl, 01000100b
  315.     MiddleLineR:
  316.         mov ah, 2h
  317.         int 10h
  318.         mov ah, 9h
  319.         int 10h
  320.         inc dh
  321.         cmp dh,14
  322.         jne MiddleLineR
  323.  
  324.     ;move cursor to the end
  325.     cursor_to 0, 23
  326.  
  327.     ;[Exiting program]
  328.     mov ah, 4ch
  329.     mov al, 0h
  330.     int 21h
  331.     code ends
  332.     end start
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement