|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
SPIM prints only first word in .data
Hey,
I'm playing around with MIPS and I have created a 'test' .data containing two words: Code:
test: .align 4 .word 0xDF5459FJ .word 0x96JGJFS0 If I then load my MIPS file in SPIM and 'print test' I get: Code:
Data seg @ 0x10010000 (268500992) = 0x0df5459f (234177951) How can I get it to print out the full contents (both words) of the test data segment? Thanks for your time. |
|
#2
|
||||
|
||||
|
The integer print function only prints one full-word (32 bit) word at a time; to print two of them in sequence, you would need to use syscall 1 twice, once for each value.
OTOH, if you need to print the value as a double, you would need syscall 3 instead. You have to keep in mind that the assembler itself has no sense of variable sizes except in the individual instructions or system calls; just because you have defined the two words with a single label does not make them part of a single variable. In assembly language, data is data is data; you can interpret the same word value as an integer, a float, an array of four characters, the high or low half of a double, or a set of 32 packed boolean flags, without regard to what data is actually stored there. The assembler imposes no structure on the data except that which you give it.
__________________
Rev First Speaker Schol-R-LEA;2 JAM LCF ELF KoR KCO BiWM TGIF #define KINSEY (rand() % 7) λ Scheme is the Red Pill Scheme in Short • Understanding the C/C++ Preprocessor Taming Python • A Highly Opinionated Review of Programming Languages for the Novice, v1.1 FOR SALE: One ShapeSystem 2300 CMD, extensively modified for human use. Includes s/w for anthro, transgender, sex-appeal enhance, & Gillian Anderson and Jason D. Poit clone forms. Some wear. $4500 obo. tverres@et.ins.gov |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > SPIM prints only first word in .data |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|