The G54, 55, etc coordinates are stored in a table in the machine. You put them there in different ways depending on what make of machine you have. You can also enter them from the program using the G10 command.
In your program for the part at G54 you have the G54 command and then all the stuff that happens to that part. Then for G55 you have that command and then the stuff for that part. If all the parts are the same you put the coding for machining the parts in a subroutine. Then you have the G54 followed by a subroutine call M97 P(or O)nnnn where the nnnn is the line n umber your subroutine starts at. The you do G55 M97 Pnnnn, etc through all the work zeroes. If you are using more than one tool you select Tool 1 and step through al the work zeroes, then change to tool 2 and do the same, etc.
If you want an example I can find one.