[Tack-devel] Accessing to unaligned data in records/structures
Moved to https://github.com/davidgiven/ack
Brought to you by:
dtrg
From: Carl E. C. <cec...@ya...> - 2019-06-11 15:34:54
|
Greetings, I am slowly working on the em instruction testsuite, and I am a bit stuck, when trying to test LOI from the below code, I get a bad pointer error in the interpreter at LOI 2, because the address is not aligned. Hence my question, how do you access the second field of this structure? What happens in pascal if the record is declared as packed, or is this just a problem associated with the interpreter? /* Unaligned structure containing the data to read. */ struct01 rom 255I1 rom -32767I2 rom 2147483647I4 #if EM_WSIZE >= 4 rom 9223372036854775807I8 #endif exp $_m_a_i_n pro $_m_a_i_n, 0 /* Unaligned structure access */ 1 lae struct01+1 /* stack address of structure */ loi 2 /* stack data from structure */ loc -32767 cmi EM_WSIZE /* check if value is what is expected. */ zeq *2 ldc __LINE__ cal $fail asp 4 Thanks for all your help,Carl |