Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Apr 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation 8088 Assembly help!!

    Ok so Im new to assembly but Currently im stuck in a situation where I need to print to screen the values in Hex. I am doing a simple hex addition to two sets of hex values and then another addition to another set right below it.

    in a quick show im trying to do the following

    10 3875 ABED F039 8DC9 ABED F039 8DC9
    + 9 ABED F039 8DC9 ABED F039 8DCA BEDF
    ------------------------------------------------------
    ########### <-- this value needs to be printed to screen in hex format


    Code:
    ! 1000289936					!1
    ! Lab 2						!2
    ! Simple Math					!3
    
    .SECT .TEXT					!4
    start:						!5
                    mov     ax,(BigVal1+14)		!6
                    add     ax,(BigVal2+14)		!7
                    mov     (BigVal3+14),ax		!8
    
                    mov     ax, (BigVal1+12)	!9
                    adc     ax, (BigVal2+12)	!10
                    mov     (BigVal3+12), ax	!11
    
                    mov     ax, (BigVal1+10)	!12
                    adc     ax, (BigVal2+10)	!13
                    mov     (BigVal3+10), ax	!14
    
                    mov     ax, (BigVal1+8)		!15
                    adc     ax, (BigVal2+8)		!16
                    mov     (BigVal3+8), ax		!17
    
                    mov     ax, (BigVal1+6)		!18
                    adc     ax, (BigVal2+6)		!19
                    mov     (BigVal3+6), ax		!20
    
                    mov     ax, (BigVal1+4)		!21
                    adc     ax, (BigVal2+4)		!22
                    mov     (BigVal3+4), ax		!23
    
                    mov     ax, (BigVal1+2)		!24
                    adc     ax, (BigVal2+2)		!25
                    mov     (BigVal3+2), ax		!26
    
                    mov     ax, (BigVal1)		!27
                    adc     ax, (BigVal2)		!28
                    mov     (BigVal3), ax		!29
    
    
    
                    mov     bx, (BigVal4+10)	!12
                    adc     bx, (BigVal5+10)	!13
                    mov     (BigVal6+10), bx	!14
    
                    mov     bx, (BigVal4+8)		!15
                    adc     bx, (BigVal5+8)		!16
                    mov     (BigVal6+8), bx		!17
    
                    mov     bx, (BigVal4+6)		!18
                    adc     bx, (BigVal5+6)		!19
                    mov     (BigVal6+6), bx		!20
    
                    mov     bx, (BigVal4+4)		!21
                    adc     bx, (BigVal5+4)		!22
                    mov     (BigVal6+4), bx		!23
    
                    mov     bx, (BigVal4+2)		!24
                    adc     bx, (BigVal5+2)		!25
                    mov     (BigVal6+2), bx		!26
    
                    mov     bx, (BigVal4)		!27
                    adc     bx, (BigVal5)		!28
                    mov     (BigVal6), bx		!29
    
    .SECT .DATA					!30
    BigVal1:        .word   0x10, 0x3875, 0xABED, 0xF039, 0x8DC9, 0xABED, 0xF039, 0x8DC9		!31
    BigVal2:        .word    0x9, 0xABED, 0xF039, 0x8DC9, 0xABED, 0xF039, 0x8DCA, 0xBEDF		!32
    BigVal4:	.word  0x102, 0x8746, 0x3943, 0x7695, 0x8912, 0x3648				!33
    BigVal5:	.word 0x3975, 0x7018, 0x7346, 0x7923, 0x8974, 0x7892				!34
    
    .SECT .BSS											!35
    BigVal3:        .word      0,      0,      0,      0,      0,      0,      0,      0		!36
    BigVal6:	.word	   0,      0,      0,      0,      0,      0				!37

  • #2
    Regular Coder Krupski's Avatar
    Join Date
    Dec 2010
    Location
    United States of America
    Posts
    505
    Thanks
    39
    Thanked 47 Times in 46 Posts
    Quote Originally Posted by atlanticspace View Post
    ########### <-- this value needs to be printed to screen in hex format
    To print stuff to the screen:

    Code:
        mov    ah,40h         ;dos write
        mov    bx,1            ;standard output
        mov    cx,bytecount  ;number of chars in buffer
        lea    dx,buffer      ;point to buffer
        int    21h             ;write to std out
    Of course, this only works in DOS and Win95/98.
    "Anything that is complex is not useful and anything that is useful is simple. This has been my whole life's motto." -- Mikhail T. Kalashnikov


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •