assembly

Error: Runtime exception … store address not aligned on word boundary

可紊 提交于 2021-02-02 09:54:29
问题 I am trying to print binary digits of any integer input and store them in the array starting at the last index. Then I am trying to print it from the array. .data prompt: .asciiz "Enter an int: " errorLarge: .asciiz "Error Value to large CANNOT be held in 16 bit" errorSmall: .asciiz "Error Value is to small CANNOT be held in 16 bits" # 64bytes =512 bits created (1 int =4 bytes):: (16 int =64 bytes) array: .space 64 newLine: .asciiz "\n" .globl main .text main: li $v0,4 la $a0,prompt syscall

Error: Runtime exception … store address not aligned on word boundary

允我心安 提交于 2021-02-02 09:50:52
问题 I am trying to print binary digits of any integer input and store them in the array starting at the last index. Then I am trying to print it from the array. .data prompt: .asciiz "Enter an int: " errorLarge: .asciiz "Error Value to large CANNOT be held in 16 bit" errorSmall: .asciiz "Error Value is to small CANNOT be held in 16 bits" # 64bytes =512 bits created (1 int =4 bytes):: (16 int =64 bytes) array: .space 64 newLine: .asciiz "\n" .globl main .text main: li $v0,4 la $a0,prompt syscall

Error: Runtime exception … store address not aligned on word boundary

别等时光非礼了梦想. 提交于 2021-02-02 09:50:31
问题 I am trying to print binary digits of any integer input and store them in the array starting at the last index. Then I am trying to print it from the array. .data prompt: .asciiz "Enter an int: " errorLarge: .asciiz "Error Value to large CANNOT be held in 16 bit" errorSmall: .asciiz "Error Value is to small CANNOT be held in 16 bits" # 64bytes =512 bits created (1 int =4 bytes):: (16 int =64 bytes) array: .space 64 newLine: .asciiz "\n" .globl main .text main: li $v0,4 la $a0,prompt syscall

ASM language pointer to an array

僤鯓⒐⒋嵵緔 提交于 2021-02-02 09:35:02
问题 my project I'm supposed to create a program that fills an array with an x number of fibbonacci numbers. In this case it's 47. I've got the programming set to get it the numbers etc, I just can't seem to get them into my array. Any help would be great as I'm sure i'm just off on my syntax. I'm debugging it in visual studio, so I guess that's masm? Thanks in advance. .386 .model flat,stdcall .stack 4096 ExitProcess proto,dwExitCode:dword .data fibba DWORD 47 DUP(?) .code main proc mov eax,1

Converting bin to hex in assembly

▼魔方 西西 提交于 2021-02-02 03:42:30
问题 I'm beginner and I need help with converting 16-bit binary number to hex. I have done most of the code, but I need help with a couple of things. How to make it only accept 0 and 1 in input and ignore the rest of numbers and letters? After conversion process I'm getting wrong number in hex. What did I do wrong? Example input: 1010101111001101 Expected output: ABCD Current output: AAAC Here's my code: .MODEL SMALL .STACK 1000h .DATA title db 'Convert BIN to HEX:.',13,10,'$' HEX_Map DB '0','1',

Minimal executable size now 10x larger after linking than 2 years ago, for tiny programs?

半世苍凉 提交于 2021-02-02 02:33:31
问题 For a university course, I like to compare code-sizes of functionally similar programs if written and compiled using gcc/clang versus assembly. In the process of re-evaluating how to further shrink the size of some executables, I couldn't trust my eyes when the very same assembly code I assembled/linked 2 years ago now has grown >10x in size after building it again (which true for multiple programs, not only helloworld): $ make as -32 -o helloworld-asm-2020.o helloworld-asm-2020.s ld -melf

Minimal executable size now 10x larger after linking than 2 years ago, for tiny programs?

旧时模样 提交于 2021-02-02 02:33:08
问题 For a university course, I like to compare code-sizes of functionally similar programs if written and compiled using gcc/clang versus assembly. In the process of re-evaluating how to further shrink the size of some executables, I couldn't trust my eyes when the very same assembly code I assembled/linked 2 years ago now has grown >10x in size after building it again (which true for multiple programs, not only helloworld): $ make as -32 -o helloworld-asm-2020.o helloworld-asm-2020.s ld -melf

MARS MIPS simulator's built-in assembler aligns more than requested?

大城市里の小女人 提交于 2021-02-01 05:14:17
问题 I have the following data segment .data a: .byte 0x11 .align 1 b: .word 0x22334455 Assuming that address "a" is 0x10010000, then the expected address for the word at b is 0x10010002, but MARS stores the word at 0x10010004, ignoring the explicit ".align" directive. By the way, I used MARS MIPS simulator (Version 4.5 on a MacBook Pro) to assemble the above code. Therefore, my question is: Is this a bug, or is it expected that the behavior of MARS differs from SGI's 1992 documentation for MIPS

MARS MIPS simulator's built-in assembler aligns more than requested?

馋奶兔 提交于 2021-02-01 05:12:18
问题 I have the following data segment .data a: .byte 0x11 .align 1 b: .word 0x22334455 Assuming that address "a" is 0x10010000, then the expected address for the word at b is 0x10010002, but MARS stores the word at 0x10010004, ignoring the explicit ".align" directive. By the way, I used MARS MIPS simulator (Version 4.5 on a MacBook Pro) to assemble the above code. Therefore, my question is: Is this a bug, or is it expected that the behavior of MARS differs from SGI's 1992 documentation for MIPS

Assembly Extended Registers not working

烈酒焚心 提交于 2021-01-29 20:43:17
问题 I am fairly new to Assembly and TASM and i have the following question. I want to use the extended version of the registers, specifically EBX. By using the code below, but without the ".386" directive, it doesn't work, saying that "Undefined symbol EBX". But with it, it doesn't recognize the INT 21h instruction which from what i understands terminated the program and is useful when debugging it with TurboDebugger. Can someone tell me how i can avoid this situation? PS: Yes, i know that TASM