assembly


Using hex numbers in MSP430 assembler


I'm new to assembly (we are using it at school with an MSP430 controller) and I'm trying to do two things.
moving an hex number to a certain location: mov #FFFh, R5 (moving it into the fifth register)
comparing an hex number with another: cmp #FFFh, #45
mov.b #0, R4 ; indice
mov.b #0, R5 ; contatore
bis.b #00000001b, P1DIR ; led rosso
bis.b #10000000b, P4DIR ; led verde
main_loop: cmp #19, R5
jz end
cmp #FFFFh, 2C00h(R4)
jnz nope
jmp yep
nope: inc.b R4
jmp main_loop
yep: inc.b R4
inc.b R5
jmp main_loop
end: cmp #5, R5
jge red_led
jmp green_led
red_led: bis.b #00000001b, P1OUT
green_led: bis.b #10000000b, P4OUT
The compiler log (we are using CCS, CodeComposer) says:
"../main.asm", ERROR! at EOF: [E0300] The following symbols are undefined:
FFFFh
How can I fix this?
A word starting with a digit (0 … 9) is interpreted as a number.
A word starting with a letter (A … Z) is interpreted as a name (of a register or a variable or a label).
So when a hexadecimal number starts with a letter, you must add a zero:
cmp #0FFFFh, 2C00h(R4)

Related Links

Emu8086 bug or bad code?
Assembler code for determining if a number is prime or not
Using %substr with NASM assembler
Changing words via bitshifting
ret is causing a segfault in assembly
Scaled offsets in ARM like in x86
Program to concatenate two strings in 8086 assembly
Assembly Error A2071: initializer magnitude too large for specific size
Access violation writing location after bubble sort
How to reverse a string in AVR Assembly language
Converting from 32 bit to 64 bit in Armv8
Compile error at MOVSD assembly operation
Segment fault (core dumbed) x86 Assembly AT&T syntax
Collatz Conjecture in Assembly shortest form
Error assembly junk at the end of line
Fastest way to add a mixture of doublewords and quadwords using AVX2?

Categories

HOME
windows
api
depth
pyqt
interface
apache-spark-mllib
fftw
graphics
rds
3d-reconstruction
telegram-bot
jetty
jquery-ui
jax-ws
pcl-crypto
pega
supervisor
microsoft-dynamics-nav
soci
topology
asp.net-core-webapi
simpleitk
articulate-storyline
href
tosca
highstock
windows-server-2003
python-2.6
android-maps-extensions
instantiation
vue-chartjs
installscript
python-import
getlasterror
node-mssql
health-monitoring
sharp-snmp
microsoft-metro
signal-strength
dapper-simplecrud
fclose
activeperl
zenhub
carrot2
bootstrap-tags-input
visual-studio-2008-sp1
clipboard.js
shopping
phpwebsocket
libav
phpgrid
highland.js
dynatree
xenomai
django-urls
fuelcms
phonertc
diff3
sip-server
tweenlite
file-not-found
unit-of-work
cnf
joomla3.1
pyunit
cuda-gdb
jquery-tools
update-statement
inline-formset
cdonts
svk
squishit
timertask
message-passing
blender-2.49
skype4java
lalr
tui
sifr3
blind

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App